package org.bt.common.extenstion;

/**
 * 多租户 tenant_id存储器
 * <p>
 * Created on 2021/8/22
 *
 * @author tongw
 */
public class TenantContext {

    public final static String TENANT_ID = "tenant-id";
    private static ThreadLocal<String> currentTenant = new ThreadLocal<>();

    public static void setTenant(String tenant) {
        currentTenant.set(tenant);
    }

    public static String getTenant() {
        return currentTenant.get();
    }

    public static void clear(){
        currentTenant.remove();
    }
}